How do you add the style to the conclusion of the table?



  • There's a code to get the table out of Oracle:

    <?php
    // коннект к базе
    $conn = oci_connect("user", "pass", "database");
    

    // выполнение запроса
    $sql = "select * from tc_uid.jkd_check";
    $res = OCIParse($conn, $sql);
    oci_execute($res);

    //начало отрисовки таблицы
    echo "<TABLE BORDER=1";
    echo "<TR>";

    // отрисовка шапки таблицы
    for ($i = 1; $i-1 < oci_num_fields($res); $i++) {
    echo "<TH>";
    echo oci_field_name($res,$i);
    echo "</TH>";
    }

    // отрисовка и заполнение самой таблицы
    while ($row = oci_fetch_row($res)) {
    echo "<TR>";
    for ($i = 0; $i < $fields=count($row); $i++) {
    echo "<TD>".$row[$i]."</TD>";
    }
    echo "</TR>";
    }
    echo "</TR></TABLE>";
    oci_close($conn)
    ?>

    Css styles should be added to the conclusion of this table (lines from table.cs):

    .sortable {border-left:1px solid #c6d5e1; border-top:1px solid #c6d5e1;
    border-bottom:none; margin:0 auto 15px}
    .sortable th { border:1px solid #c6d5e1 } /*text-align:left;

    color:#cfdce7;*/
    .sortable th h3 {padding:6px 8px 8px}
    .sortable td {padding:4px 6px 6px; border-bottom:1px solid #c6d5e1; border-
    right:1px solid #c6d5e1}
    .sortable .head h3 {background:url(images/sort.gif) 7px center no-repeat;
    cursor:pointer; padding-left:18px}
    .sortable .desc h3 {background:url(images/desc.gif) 7px center no-repeat;
    cursor:pointer; padding-left:18px}
    .sortable .asc h3 {background:url(images/asc.gif) 7px center no-repeat;
    cursor:pointer; padding-left:18px}
    .sortable .oddrow td {background:#ecf2f6}
    .sortable td.evenselected {background:#ecf2f6}
    .sortable td.oddselected {background:#dce6ee}

    The question is how to do that? Where do you want me to sign the style?
    I'm sorry for the stupid question, I don't really understand that conclusion. Help me, please.



  • Just add the class to the element that you're getting off with php. For example:

    echo '<TABLE class="sortable" BORDER="1">';
    

    In echo, use a single bracket and class/style double to avoid mistakes. Well, don't forget to connect your own style file.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2