function get_b_cf7_func() {
global $wpdb;
$table_name = $wpdb->prefix . 'sell';
$user = wp_get_current_user()->user_login;
$query = $wpdb->get_row("SELECT * FROM ".$table_name." WHERE user_name='".$user."'");
return $res_;
<div class='img_out_f'>
<div class='content'>
<div class='tbl'>Столбец 1</br></br>
<div class='tbl'>строка 1</div>
<div class='tbl'>строка 2</div>
</div>
<div class='tbl'>Столбец 2</br></br>
<div class='tbl'>строка 1</div>
</div>
<div class='tbl'>Столбец 3</br></br>
<div class='tbl'>строка 1</div>
</div>
<div class='tbl'>Столбец 4</br></br>
<div class='tbl'>строка1</div>
</div>
<div class='tbl'>Столбец 5</br></br>
<div class='tbl'>строка 1</div>
</div>
</div>
</div>
function get_b_cf7_func() {
global $wpdb;
$table_name = $wpdb->prefix . 'sell';
$user = wp_get_current_user()->user_login;
$query = $wpdb->get_results("SELECT * FROM ".$table_name." WHERE user_name='".$user."'");
$include_var = '';
foreach ($query as $q ):
$include_var .= "<tr><td>".$q->coin."</td><td>".$q->bank."</td><td>".$q->cours."</td></tr>";
$str = "<table class='table'<thead><tr><th> Title </th><th>Content</th><th>Date</th></tr></thead><tbody>".$include_var."</tbody></table>";
endforeach;
$str_ = $str;
return $str_;
}
add_shortcode('get_b', 'get_b_cf7_func');
$arr[$i]['столбец_1'], $arr[$i]['столбец_2'], ....
<table>
<?php foreach($arr as $el): ?>
<tr>
<td><?php echo $el['столбец_1']; ?></td>
<td><?php echo $el['столбец_2']; ?></td>
....
</tr>
<?php endforeach; ?>
</table>
<table>
, специально для такого вывода данных.