0
votes

I have two tables:

First table has 2 rows and 4 columns. The first column has a row span of 2. In the picture however the last 3 columns are not aligned with the two rows. How can this be fixed?

In addition, this table has been made so that it is equal sizes by columns.

Table 2 has also 3 columns but several rows. However it seems that the first 3 columns have squashed together. Can anyone see the problem? I think it might be in my CSS.

This is the image

HTML for the table:

<table class="equalDevide" cellpadding="0" cellspacing="0" width="100%" border="0">

Here is my HTML for the first table row 1 column 2

<td>
            <div id="positionAnchor">
                <img src="adele.jpg" alt="Adele">
                <div id="bottom">
                    <h4 class="topText">ALBUM</h4>
                    <h3 class ="topText">ADELE 21 COVER </br> ADELE</h3>
                </div></div>
        </td>

row 2 column 2

<tr id="left-col">
            <td>
                <div id="caption-color">
                    <h3 id="active">Adele 21 Album</h3>
                    <p class="music-name"><span class ="glyphicon glyphicon-headphones"> Adele - Skyfall</span></p>
                </div>
            </td>

this is the CSS that goes along with it:

#bottom{
position: absolute;
display: inline-block;
bottom: 0px;
left:0px;
}

#positionAnchor {
    position: relative;
 width:1px;
}



#caption-color{
background-color: #212121;
position: relative;
display: inline-block;
bottom: 0px;
padding: 5px;
float: bottom;
}

 .equalDevide td { 
width:25%; 
 }

Second table html :

<table class="table">
        <tbody>
            <tr>
                <td  id="left-info">
                    <span class="glyphicon glyphicon-calendar"> 17 SEPTEMBER</span>
                </td>
                <td  id="left-info">
                    <span class="glyphicon glyphicon-music" > MARTIN GARRIX</span>
                </td>
                <td  id="left-info">
                    <span class="glyphicon glyphicon-map-marker"> NEW ORLEANS,LA</span>
                </td>
                <td id="buyNow">
                    Buy Now
                </td>
            </tr>

Second table CSS:

table{
border-collapse: collapse;
}
tr{

background-color: #575757;
border-top: 10px solid #383D3D !important;
}

td{
border-left: 3px solid #383D3D !important;
text-align: center;
 }
1

1 Answers

1
votes

Match #caption-color CSS and positionAnchor CSS up ...

#positionAnchor {
    position: relative;
    display: inline-block;
    text-align:center; /* and center text */
}

the 2nd table css rules are not what you think.

table{ ... rules for element table }
.table{ ... rules for class table }