help me border and padding table
-
Hello
i have use your code
but i dont know how i can border, padding this field display on post
i have try css
.table {
border: 1px solid;
}
but not success
help me
thanks youhttps://ww.wp.xz.cn/plugins/advanced-custom-fields-table-field/
-
I did a basic example on http://codepen.io/johannheyne/pen/YPooYq/ for you, how to give the table cells a border and how to remove the space between the cells.
Good luck!
thanks you
but i can’t apply it to field
can you help me add to this code<?php $rows = get_field('repeater_field_name'); if($rows) { echo '<ul>'; foreach($rows as $row) { echo '<li>sub_field_1 = ' . $row['sub_field_1'] . ', sub_field_2 = ' . $row['sub_field_2'] .', etc</li>'; } echo '</ul>'; } ?>Sorry, but I do not understand your question. Your code is about an repeater field and puts out a list and not a table.
yes i want display repeatfield in table
Maybe this is what helps you displaying a repeater fields content as a table.
<?php $rows = get_field( 'repeater_field_name' ); if ( $rows ) { echo '<table>'; foreach( $rows as $row ) { echo '<tr>'; foreach ( $row as $cell ) { echo '<td>' . $cell . '</td>'; } echo '</tr>'; } echo '</table>'; } ?>i have try with your new code but
it not sucess
you can see
it display
http://oi60.tinypic.com/357rs5t.jpg<?php $rows = get_field( 'repeater_field_name' ); if ( $rows ) { echo '<table class="table">'; foreach( $rows as $row ) { echo '<tr>'; foreach ( $row as $key => $value ) { echo '<td>' . $value . '</td>'; } echo '</tr>'; } echo '</table>'; } ?>In the stylessheet:
.table td { border: 1px solid black; } /* removing space between cells and let the cell borders collapse */ .table { border-collapse: collapse; }this is my code
<?php $rows = get_field('repeater_field_name'); if($rows) { echo '<table class="table">'; foreach($rows as $row) { echo '<tr>'; foreach ( $row as $key => $value ) { echo '<td>Channel:' . $value['channel_link'] .', Link:' . $value['link_live'] .', etc</td>'; } echo '</tr>'; } echo '</table>'; } ?>i have use your code but it get value not true
i want display Value in a table and link and a table
you can see pichttp://oi62.tinypic.com/289l8nb.jpg http://oi60.tinypic.com/6igns1.jpg http://oi59.tinypic.com/2a6petw.jpgOK, try this…
<?php $rows = get_field('repeater_field_name'); if($rows) { echo '<table class="table">'; foreach($rows as $row) { echo '<tr>'; foreach ( $row => $fields ) { echo '<td>Channel:' . $fields['channel_link'] .', Link:' . $fields['link_live'] .', etc</td>'; } echo '</tr>'; } echo '</table>'; } ?>Thanks you very much
<?php
$rows = get_field(‘repeater_field_name’);
if($rows)
{
echo ‘<table class=”table”>’;foreach($rows as $row)
{
echo ‘<tr>’;
foreach ( $row => $fields )
{
echo ‘<td>Channel:’ . $fields[‘channel_link’] .’, Link:’ . $fields[‘link_live’] .’, etc</td>’;}
echo ‘</tr>’;
}echo ‘</table>’;
}
?>i have try with this code but it report error whitepage.
i have try $row as $key => $fields but i receive same this picture
http://oi60.tinypic.com/6igns1.jpgi think it can’t doing with my request
The topic ‘help me border and padding table’ is closed to new replies.