Skip to content

Commit

Permalink
Add id to table rows by using table id and row id
Browse files Browse the repository at this point in the history
  • Loading branch information
Thai Wood committed Feb 5, 2018
1 parent 69d3ffd commit d6db1fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inline-gdocs-viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ private function dataToHtml ($r, $options, $caption = '') {

$html .= "<thead>\n";
foreach ( $thead as $v ) {
$html .= "<tr class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$html .= "<tr id=\"" . esc_attr( $id ) . '-row-$ir" class="row-$ir ' . $this->evenOrOdd( $ir ) . "\">";
$ir++;
$ic = 1; // reset column counting
foreach ( $v as $th ) {
Expand All @@ -628,7 +628,7 @@ private function dataToHtml ($r, $options, $caption = '') {
if ( $tfoot ) {
$html .= "<tfoot>\n";
foreach ( $tfoot as $v ) {
$html .= "<tr class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$html .= "<tr id=\"" . esc_attr( $id ) . "-row-$ir\" class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$ir++;
$ic = 1; // reset column counting
foreach ( $v as $td ) {
Expand All @@ -644,7 +644,7 @@ private function dataToHtml ($r, $options, $caption = '') {

$html .= "<tbody>\n";
foreach ( $tbody as $v ) {
$html .= "<tr class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$html .= "<tr id=\"" . esc_attr( $id ) . "-row-$ir\" class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$ir++;
$ic = 1; // reset column counting
foreach ( $v as $td ) {
Expand Down

0 comments on commit d6db1fd

Please sign in to comment.