I want CKEditor to be shown on each row ot a table, but it appears only on the first row. On the other rows only textarea is shown, without CKEditor. I use Codeigniter. That's my view:
<?php
foreach ($query as $row) {
echo "<table border='1'>";
echo "<tr>";
?>
<td class='col-md-2'>
<textarea name="content" id="content"></textarea>
<?php
echo display_ckeditor($ckeditor);
?>
</textarea></td></tr>
<?php
}
?>
My controller is:
<?php
//some code
$data['ckeditor'] = array(
'id' => 'content',
'path' => 'js/ckeditor',
'config' => array(
'toolbar' => "Full",
'width' => "550px",
'height' => '100px',
),
)
)
);
How should be done to be shown on each row?
</div>
****Download ckeditor from here :**
http://ckeditor.com/download (basic packeg)
**Code**:-
<html>
<head>
<title>CKEditor with jQuery</title>
<!-- JQUERY LIBRARY -->
<script type="text/javascript" src="jquery-1.9.1.js"></script>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="ckeditor/adapters/jquery.js"></script>
<script type="text/javascript">
$(function(){
$('.content').ckeditor();
});
</script>
</head>
<body>
<h1>CKEditor with jQuery</h1>
<form id="editor_form" method="post" action="index.html">
<textarea class = "content"></textarea><br>
<textarea class = "content"></textarea><br>
<textarea class = "content"></textarea><br>
<textarea class = "content"></textarea><br>
<textarea class = "content"></textarea><br>
<textarea class = "content"></textarea><br>
<textarea class = "content"></textarea><br>
<textarea class = "content"></textarea><br>
<textarea class = "content"></textarea><br>
</form>
</body>
</html>
**Folder Structure** (in xampp/htdocs i have created a folder name stackoverflow):-
Try to give id dynamically rather than 'content'.