View Full Version : [HTML?] Formattazione di un Tabella
franksisca
05-02-2013, 11:28
devo fare una tabella che abbia questa forma
-----------------------------
| < mese > < anno > |
-----------------------------
|lun|mar|mer|gio|ven|sab|dom|
-----------------------------
| giorni del mese |
-----------------------------
vorrei che la riga "mese e anno" fosse indipendente dalle colonne dei giorni, intendo come larghezza.
ora invere nei mesi più "lunghi" mi si ridimensionano ovviamente anche i giorni. esiste un modo per fare ciò?
Beh, per farle essere indipendenti forse ti tocca fare 2 tabelle diverse?
Senò prova a spiegarci meglio cosa devi fare! Magari allega il codice html che usi!
franksisca
05-02-2013, 20:04
Beh, per farle essere indipendenti forse ti tocca fare 2 tabelle diverse?
Senò prova a spiegarci meglio cosa devi fare! Magari allega il codice html che usi!
al momneto non ho codice...devo fare un semplice calendario che ha mesi e anni che cambiano indimendentemente (da qui le due freccette) e i giorni normalmente
Così va bene?
<table align="center" border="1" width="750px">
<thead>
<tr>
<th colspan='3'>Mese</th>
<th colspan='4'>Anno</th>
</tr>
</thead>
</table>
<table align="center" border="1" width="750px">
<thead>
<tr>
<td>Lunedì</td>
<td>Martedì</td>
<td>Mercoledì</td>
<td>Giovedì</td>
<td>Venerdì</td>
<td>Sabato</td>
<td>Domenica</td>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
</tbody>
</table>
franksisca
05-02-2013, 23:57
Così va bene?
<table align="center" border="1" width="750px">
<thead>
<tr>
<th colspan='3'>Mese</th>
<th colspan='4'>Anno</th>
</tr>
</thead>
</table>
<table align="center" border="1" width="750px">
<thead>
<tr>
<td>Lunedì</td>
<td>Martedì</td>
<td>Mercoledì</td>
<td>Giovedì</td>
<td>Venerdì</td>
<td>Sabato</td>
<td>Domenica</td>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
</tbody>
</table>
no, perchè ho anche le frecce di navigazione, quindi
<tr>
<th colspan='3'>Mese</th>
<th colspan='4'>Anno</th>
</tr>
diventerebbe
<tr>
<th ><</th>
<th colspan='2'>Mese</th>
<th >></th>
<th ><</th>
<th >Anno</th>
<th >></th>
</tr>e la formattazione salterebbe, e i giorni comunque sono abbreviati a 3 caratteri.
<html>
<head>
<title></title>
<style type="text/css">
table {
border-spacing:0;
border-collapse:collapse;
border: 1px solid black;
}
table thead tr {
border: 2px solid black;
}
table thead tr td{
border: 2px solid black;
padding: 0.1em;
text-align: center;
}
td {
width: 2em;
text-align: center;
}
table tbody tr td{
border: 1px solid black;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th><</th>
<th>Mese</th>
<th>></th>
<th></th>
<th><</th>
<th>Anno</th>
<th>></th>
</tr>
<tr>
<td>Lun</td>
<td>Mar</td>
<td>Mer</td>
<td>Gio</td>
<td>Ven</td>
<td>Sab</td>
<td>Dom</td>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
<tr>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
</tr>
<tr>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
</tr>
<tr>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
<td>26</td>
<td>27</td>
<td>28</td>
</tr>
<tr>
<td>29</td>
<td>30</td>
<td>31</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
cosi?
edit: ho aggiunto un minimo di formattazione
franksisca
06-02-2013, 14:07
....
cosi?
edit: ho aggiunto un minimo di formattazione
grazie, appena possibile lo provo, grazie mille comunque
no, perchè ho anche le frecce di navigazione, quindi
<tr>
<th colspan='3'>Mese</th>
<th colspan='4'>Anno</th>
</tr>
diventerebbe
<tr>
<th ><</th>
<th colspan='2'>Mese</th>
<th >></th>
<th ><</th>
<th >Anno</th>
<th >></th>
</tr>e la formattazione salterebbe, e i giorni comunque sono abbreviati a 3 caratteri.
Ok, ma se le frecce invece di metterle in una nuova colonna le mettessi nella stessa in cui c'è scritto Mese e Anno non cambierebbe, cioè così:
<thead>
<tr>
<th colspan='3'>< Mese ></th>
<th colspan='4'>< Anno ></th>
</tr>
</thead>
Ps. ovviamente al posto di < e > devi usare < e > come giustamente fatto da "pierosa"! ;-)
franksisca
07-02-2013, 17:55
no perchè su quelle freccete ci sono collegati javascript...o meglio, forse si posso farlo....ci metto un <a....../> e vedo se ci riesco ;)
grazie per la dritta
Figurati! ;-)
Poi facci sapere se ci riesci! ;-)
franksisca
07-02-2013, 18:52
Figurati! ;-)
Poi facci sapere se ci riesci! ;-)
se riesco a slegarmi dalle altre cose si, ovvio che vi faccio sapere :D
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.