Jump to content

Recommended Posts

Hello everybody,


I've created a table in HTML and while layout and styling with CSS is working nicely, the text of the first cell is very slightly shifted towards the bottom and therefore not aligned with the rest of the text in the other cells.




What is the reason for this and how can this issue be solved ?


Thank you very much in advance !

Link to post
Share on other sites
  • 2 weeks later...

Css table

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Css Table</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">* { margin: 0; padding: 0}.container { background-color: #998FCC; width: 800px; border: 1px solid gray;}* html .container { width: 820px;}.header { width: 800px; border-bottom: 1px solid blue;}.header ul { list-style: none}.header ul li { width: 160px; border-left: 1px solid red; float: left; font-weight: bold; padding-left: 2px;}* html .header ul li { width: 180px;}.data { width: 180px; float: left; padding-left: 2px;}* html .data { width: 182px;}.rowodd,.roweven { position: relative; width: 800px; border-top: 1px solid #000; background-color: pink;}.roweven { background-color: #f79455;}.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden;}.clearfix { display: inline-block;}</style></head><body><div class="container clearfix"> <div class="header clearfix"> <ul> <li>Column 1</li> <li>Column 2</li> <li>Column 3</li> <li>Column 4</li> <li>Column 5</li> </ul></div> <div class="rowodd clearfix"> <div class="data"> <p>Company 1</p> <p>happycodings1</p> <p>happycodings2</p> <p>happycodings3</p> <p>happycodings4</p> </div> <div class="data"><p>paragraph</p></div> <div class="data"><p>paragraph</p></div> <div class="data"><p>paragraph</p></div> <div class="data"><p>paragraph</p></div> </div> <div class="roweven clearfix"> <div class="data"> <p>Company 1</p> <p>code example</p> <p>code example</p> <p>code example</p> <p>code example</p> </div> <div class="data"><p>java</p></div> <div class="data"><p>php</p></div> <div class="data"><p>android</p></div> <div class="data"><p>c++</p></div> </div> <div class="rowodd clearfix"> <div class="data"> <p>Company 1</p> <p>happy</p> <p>happy</p> <p>happy</p> <p>happy</p> </div> <div class="data"><p>codes</p></div> <div class="data"><p>codes</p></div> <div class="data"><p>codes</p></div> <div class="data"><p>codes</p></div> </div></div></body></html>

Edited by Ingolme
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...