0

How is equivalent align and colspan table's tag in .css style file? For example

 <table colspan="2" align="center">
John Conde
  • 217,595
  • 99
  • 455
  • 496
  • They are different things. That's why they both exist instead of just one of them. You probably need to explain why you;re asking for this to be considered a valid question. – John Conde Aug 07 '13 at 13:08
  • Same problem http://stackoverflow.com/questions/2403990/html-colspan-in-css – m1k1o Aug 07 '13 at 13:09
  • @Vlad Noname, Check my answer. Brief explanation – AnaMaria Aug 07 '13 at 13:27

1 Answers1

0

Let me elaborate a bit.

colspan defines the number of columns a cell should span in a group of columns.

Example :DEMO FIDDLE

<table border="1">
  <tr>
    <td>Cell A</td>
    <td>Cell B</td>
    <td>Cell C</td>
  </tr>
  <tr>
    <td colspan="3">Cell ABC</td>
  </tr>
</td>
</table>

In this example i have specified colspan="3" for the second row <td>. Hence this <td> will span 3 columns of the table.

align is a style attribute which has 3 options left, right, centre. This will determine where you want to place the table on your page.

Example:

<table align="center">
    <tr>
        <td>Cell A</td>
        <td>Cell B</td>
        <td>Cell C</td>
    </tr>
</table>
Ajay_Dhama
  • 13
  • 5
AnaMaria
  • 3,520
  • 3
  • 19
  • 36