CSS Tutorials

CSS: Tables & CSS Formatting

You may have noticed that there are a lot of deprecated attributes in relation to tables. Many have asked how to validate with this happening. The solution: put all your formatting in your CSS (style sheet) file, or in your <style> tags. Below is an example how to do this for a basic table setup.

All attributes below are just examples, customize to suit.

HTML File:
<table class=”one”>
<tr><td>text/image</td><td>text/image</td></tr>

<tr><td>text/image</td><td>text/image</td></tr>
<tr><td>text/image</td><td>text/image</td></tr>

<tr><td>text/image</td><td>text/image</td></tr>
<tr><td>text/image</td><td>text/image</td></tr>

<tr><td>text/image</td><td></td></tr>
</table>

CSS File:
table.one {
width: 80%;
border: 0.05em #6699CC solid;

border-collapse: collapse;
}

table.one td {
text-align: center;
font-family: Arial, Helvetica, Verdana, sans-serif;
font-weight: normal;
font-size: 0.80em;
color: #404040;
width: 50%;

background-color: #fafafa;
border: 0.05em #6699CC solid;
border-collapse: collapse;
}

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

Comments: 2

  • admin says:

    qqqqqqqqqqqqqq

  • admin says:

    Cool! Thanks

Post your comment

This question is for testing whether you are a human visitor and to prevent automated spam submissions. Please type the term 'Super Hosting' in the text box below:*

Fields with * are manadatory